package com.ruanyun.modular.admin.mapper;

import com.ruanyun.modular.admin.entity.TCommitReport;
import com.ruanyun.modular.admin.model.params.TCommitReportParam;
import com.ruanyun.modular.admin.model.result.TCommitReportResult;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 报告提交表 Mapper 接口
 * </p>
 *
 * @author zs
 * @since 2021-04-28
 */
@Repository
public interface TCommitReportMapper extends BaseMapper<TCommitReport> {

    /**
     * 获取列表
     *
     * @author zs
     * @Date 2021-04-28
     */
    List<TCommitReportResult> customList(@Param("paramCondition") TCommitReportParam paramCondition);

    /**
     * 获取map列表
     *
     * @author zs
     * @Date 2021-04-28
     */
    List<Map<String, Object>> customMapList(@Param("paramCondition") TCommitReportParam paramCondition);

    /**
     * 获取分页实体列表
     *
     * @author zs
     * @Date 2021-04-28
     */
    Page<TCommitReportResult> customPageList(@Param("page") Page page, @Param("paramCondition") TCommitReportParam paramCondition);

    /**
     * 获取分页map列表
     *
     * @author zs
     * @Date 2021-04-28
     */
    Page<Map<String, Object>> customPageMapList(@Param("page") Page page, @Param("paramCondition") TCommitReportParam paramCondition);

    @Select("select * from t_commit_report where company_id = #{id}")
    TCommitReport getCommit(@Param("id") Integer id);

    @Select("select count(*) from t_commit_report where company_id = #{companyId} and del_flag != 2 ")
    Integer getIsCommit(@Param("companyId") Integer companyId);


   @Select("select * from t_commit_report where company_id = #{companyId} and del_flag != 2")
   TCommitReport getDetailByCid (@Param("companyId")Integer companyId);

}
